package com.itcast.donkey.adapters;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * Created by lanouhn on 16/9/1.
 */
public class TravelAdapter extends FragmentPagerAdapter {
    private ArrayList<Fragment> lists;
    private String[] tabs;

    public TravelAdapter(FragmentManager fm, ArrayList<Fragment> lists, String[] tabs) {
        super(fm);
        this.lists = lists;
        this.tabs = tabs;
    }

    @Override
    public Fragment getItem(int position) {
        return lists.get(position);
    }

    @Override
    public int getCount() {
        return lists.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return tabs[position];
    }
}
